package ve.com.ucv.changedetection.model;

//import com.google.code.morphia.Datastore;
//import com.google.code.morphia.Morphia;
//import com.mongodb.Mongo;
import org.apache.log4j.Logger;
import ve.com.ucv.changedetection.objects.Constants;

import javax.sql.DataSource;
import java.io.IOException;
import java.net.UnknownHostException;
import java.sql.*;

/**
 * Created with IntelliJ IDEA.
 * User: josmaguirre
 * Date: 6/7/13
 * Time: 12:00 PM
 * To change this template use File | Settings | File Templates.
 */
public class ConnectionManager {
    public static Logger logger = Logger.getLogger(ConnectionManager.class);
    public DataSource dataSource;
    public Connection getMySQLConnection() {
        try {
            return getDataSource().getConnection();
        } catch (SQLException e) {
            e.printStackTrace();
            logger.error(e);
            return null;
        }
    }

    public DataSource getDataSource() {
        return this.dataSource;
    }

    public void setDataSource(DataSource dataSource) {
        this.dataSource = dataSource;
    }
}
